package val.to.UI;


import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageButton;

public class MenuButton extends ImageButton {

	Activity mParentActivity;
	
    public MenuButton(Context context) {
        super(context);
    }

    public MenuButton(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MenuButton(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }
    
    public void init(final Activity activity) {
        mParentActivity = activity;
        setOnClickListener(new ButtonOnClickListener());
    }

    private final class ButtonOnClickListener implements OnClickListener {

        @Override
        public void onClick(View v) {
			Intent intent = new Intent(v.getContext(), UserProfileActivity.class);
			((Activity) mParentActivity).startActivity(intent);
        }
    }
}
